<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>志愿者招募管理</title>
    <script type="text/javascript" src="${ctx}/static/myJs/util.js"></script>
    <script type="text/javascript" src="${ctx}/static/myJs/groupRecruitController.js"></script>
</head>

<body>
<div class="content">
    <div class="page-subcate-list">
        <div class="page-searchbox">
            <input type="text" placeholder="按招募标题关键字查询" id="key">

            <div class="pull-right">
                <!--
                <button>批量导入</button>
                -->
                <button onclick="javascript:searchByTitle();"><i class="fa fa-plus" aria-hidden="true"></i>查询</button>
                <a href="${ctx}/groupRecruit/add">
                    <button><i class="fa fa-plus" aria-hidden="true"></i>新建</button>
                </a>
            </div>
        </div>
<%--        <div class="page-subcate-item">
            <label>服务领域</label>
            <ul class="choices">
                <c:forEach items="${userServiceFiled}" var="skill">
                    <li><a href="${skill.name}">${skill.name}</a></li>
                </c:forEach>
            </ul>
				<span class="more">
					<a href="#">更多 <i class="fa fa-angle-down" aria-hidden="true"></i></a>
				</span>
        </div>
        <div class="page-subcate-item">
            <label>专业技能</label>
            <ul>
                <c:forEach items="${userSkill}" var="skill">
                    <li><a href="${skill.name}">${skill.name}</a></li>
                </c:forEach>
            </ul>
				<span class="more">
					<a href="#">更多 <i class="fa fa-angle-down" aria-hidden="true"></i></a>
				</span>
        </div>
        <div class="page-subcate-item">
            <label>职业</label>
            <ul class="choices">
                <c:forEach items="${userJob}" var="skill">
                    <li><a href="${skill.name}">${skill.name}</a></li>
                </c:forEach>
            </ul>
				<span class="more">
					<a href="#">更多 <i class="fa fa-angle-down" aria-hidden="true"></i></a>
				</span>
        </div>--%>
    </div>

    <table class="table table-bordered">
        <thead>
        <tr>
            <th>标题</th>
            <th>截止日期</th>
            <th>需要人数</th>
            <th>报名人数</th>
            <th>状态</th>
            <th style="text-align:center">操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${data.content}" var="item">
            <tr id="groupRecruit_${item.id}">
                <td>${item.title}</td>
                <td>${fn:substring(item.stopApplyTime, 0, 10)}</td>
                <td>${item.needs}</td>
                <td>${item.applys}</td>
                <td>
                    <c:if test="${item.status==1}">
                        <font color="green">进行中</font>
                    </c:if>
                    <c:if test="${item.status==2}">
                        已结束
                    </c:if>
                </td>
                <td align="center">
                    <a href="${ctx}/groupRecruit/detail/${item.id}">查看</a>
                    <c:if test="${item.status==1}">
                    <a href="${ctx}/groupRecruit/edit/${item.id}">编辑</a>
                    <a href="javascript:cancelRecruit('${item.id}');">取消</a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <tags:pagination page="${data}" paginationSize="5"/>

</div>
</body>
</html>
